curl -XPOST 'http://localhost:9200/parent_child' -d '{
    "settings": {
        "number_of_shards": 5,
        "number_of_replicas": 1
    },
    "mappings": {
        "store": {
            "properties": {
                "name": {
                    "type": "string"
                },
                "owner": {
                    "type": "string"
                }
            }
        },
        "department": {
            "_parent": {
                "type": "store"
            },
            "properties": {
                "name": {
                    "type": "string"
                },
                "numberOfProducts": {
                    "type": "long"
                }
            }
        },
        "product": {
            "_parent": {
                "type": "department"
            },
            "_routing": {
                "required": true,
                "path": "store_id"
            },
            "properties": {
                "name": {
                    "type": "string"
                },
                "trademark": {
                    "type": "string"
                },
                "price": {
                    "type": "long"
                },
                "store_id": {
                    "type": "string"
                }
            }
        }
    }
}'